<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script>
$(function() {
	var form = jfinal.form('inputFrom_${r"${timer }"}', '${r"${contextPath }"}/${r"${model }"}/save', '${r"${datagrid }"}', '${r"${dialog }"}', '${tableName }_span_${r"${timer }"}');
	form.form({
		onSubmit : function() {
			return checkform${className }();
		},
	});
});

/**
 * 表单验证
 */
function checkform${className }() {
	var flag = true; 
<#list columnList as column>
<#if column.columnName != "id">
	var ${column.columnName} = ${r"$"}.trim(${r"$"}("#${column.columnName}_${r"$"}{timer }").val());
	if( ${column.columnName} == null || ${column.columnName} == "" ){
		flag = false;
		$("#${column.columnName}_span_${r"$"}{timer }").html("必录项!");
	}else if(${column.columnName}.length>15){
		flag = false;
		$("#${column.columnName}_span_${r"$"}{timer }").html("长度不能超过15个字符！");
	}else{
		$("#${column.columnName}_span_${r"$"}{timer }").html("");
	}
</#if>
</#list>	
	return flag;
}
</script> 
<div>
	<form id="inputFrom_${r"${timer }"}" method="post">
			<table style="border: solid #000 1px; width: 100%">
			<#list columnList as column>
			<#if column.columnName != "id">
				<tr>
					<td width="18%" class="report-label">${column.columnName}:<font color="red">*</font></td>
					<td width="82%">
						<input id="${column.columnName}_${r"${timer }"}" name="${tableName }.${column.columnName}" style="width:200px;"  maxlength="17"/>
						<font color="red"><span id="${column.columnName}_span_${r"${timer }"}"></span></font>
					</td>
				</tr>
			</#if>
			</#list>
			</table>
			<font color="red"><span id="${tableName }_span_${r"${timer }"}"></span></font>
		<hr>
		<div id="dlg-buttons" style="text-align:center;">
        	<a id="btnSubmit" onclick="jfinal.onSave('inputFrom_${r"${timer }"}')" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-save'">确认</a>
			<a id="btnReset" onclick="jfinal.onClose('${r"${dialog }"}')" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'">取消</a>
        </div>
	</form>
</div>